import Lexer

def getVectorCAutomata():
    automata = Lexer.DeterministicAutomata()
    
    transitions = [ 
         # state1    state2      sink    ahead   silent  symbol
        ["s",       "silent",   False,  True,   False,  " "],
        ["s",       "silent",   False,  True,   False,  "\n"],
        ["s",       "silent",   False,  True,   False,  "\t"],        
        ["s",       "^",      True,   True,   False,  ""],
        
        ["silent",  "s",        False,  False,  True,   "EVERYTHING"],          
        
# COMMENT
        ["s",       "comm1",    False,  False,  False,  "/"],
        ["comm1",   "comm2",    False,  False,  False,  "*"],
        ["comm2",   "comm3",    False,  False,  False,  "*"],
        ["comm3",   "COMMENT",  True,   False,  False,  "/"],
        ["comm3",   "comm3",    False,  False,  False,  "*"],
        ["comm3",   "comm2",    False,  False,  False,  "EVERYTHING"],
        ["comm2",   "comm2",    False,  False,  False,  "EVERYTHING"],
    
        ["comm1",   "_comm4",   False,  False,  False,  "/"],
        ["_comm4",  "COMMENT",  True,   False,  True,   "\n"],
        ["_comm4",  "_comm4",   False,  False,  False,  "EVERYTHING"],
        
# DIV        
        ["comm1",   "DIV",      True,   True,  True,  "EVERYTHING"],
        
# ID
                    
        ["s",       "alpha1",   False,  False,  False,  "ANY_ALPHA"],
        ["alpha1",  "alpha1",   False,  False,  False,  "ANY_ALNUM"],
        ["alpha1",  "alpha1",   False,  False,  False,  "_"],
        ["alpha1",  "ID",       True,   True,   False,  "EVERYTHING"],
    
# LPAREN
        ["s",       "LPAREN",   True,   False,  False,  "("],
    
# RPAREN
        ["s",       "RPAREN",   True,   False,  False,  ")"],
    
# LFPAREN
        ["s",       "LFPAREN",  True,   False,  False,  "{"],
    
# RFPAREN
        ["s",       "RFPAREN",  True,   False,  False,  "}"],

# LSPAREN
        ["s",       "LSPAREN",  True,   False,  False,  "["],
    
# RSPAREN
        ["s",       "RSPAREN",  True,   False,  False,  "]"],
        
        
# EQUALS
        ["s",       "eq1",      False,   False,  False,  "="],
        ["eq1",     "EQUALS",   True ,   False,  False,  "="],
        ["eq1",     "EQASSIGN", True,    True,   False,  "EVERYTHING"],

# DOT
        ["s",       "DOT",      True,   False,  False,  "."],
    
# SEMICOLON
        ["s",       "SEMICOLON",True,   False,  False,  ";"],
    
# COLON
        ["s",       "COLON",    True,   False,  False,  ","],
        
# MULT
        ["s",       "MULT",     True,   False,  False,  "*"],
    
# TEXT
        ["s",       "aste1",    False,  False,  False,  "\""],
        ["aste1",   "TEXT",     True,   False,  False,  "\""],
        ["aste1",   "aste1",    False,  False,  False,  "EVERYTHING"],
    
# <
        ["s",       "less1",    False,  False,  False,  "<"],
        ["less1",   "LEQU",     True,   False,  False,  "="],
        ["less1",   "LESS",     True,   True,   False,  "EVERYTHING"],
    
# >
        ["s",       "great1",   False,  False,  False,  ">"],
        ["great1",  "GEQU",     True,   False,  False,  "="],
        ["great1",  "GREAT",    True,   True,   False,  "EVERYTHING"],
    
# != 
        ["s",       "nequ1",    False,  False,  False,  "!"],
        ["nequ1",   "NEQU",     True,   False,  False,  "="],
        ["nequ1",   "NOT",      True,   True,   False,  "EVERYTHING"],
    
# DIGIT
        ["s",       "digit1",   False,  False,  False,  "ANY_DIGIT"],
        ["digit1",  "digit1",   False,  False,  False,  "ANY_DIGIT"],
        ["digit1",  "DIGIT",    True,   True,   False,  "ANY_SEPARATOR"],
        ["digit1",  "digit2",   False,  False,  False,  "."],
        ["digit2",  "digit2",   False,  False,  False,  "ANY_DIGIT"],
        ["digit2",  "DOUBLE",   True,   True,   False,  "ANY_SEPARATOR"],
    
# PLUS
        ["s",       "inc1",     False,  False,  False,  "+"],
        ["inc1",    "INCREMENT",True,   False,  False,  "+"],
        ["inc1",    "PLUS",     True,   True,   False,  "EVERYTHING"],
    
# MINUS
        ["s",       "dec1",     False,  False,  False,  "-"],
        ["dec1",    "DECREMENT",True,   False,  False,  "-"],
        ["dec1",    "MINUS",    True,   True,   False,  "EVERYTHING"],
    ]
    
    for t in transitions:
        state1, state2, sink, ahead, silent, symbol = t
        automata.addTransition( Lexer.State(state1), Lexer.State(state2, sink, ahead, silent), symbol )
    
    return automata
